<?php


namespace app\api\controller\v1;


use app\api\controller\BaseController;
use app\logic\AdvertsLogic;
use app\logic\MessageLogic;
use app\logic\SurroundingLogic;
use app\logic\NewsLogic;
class Message extends BaseController
{
    protected $name = '消息';

    protected $methodName = [
        'getAdverts'            => '获取广告列表',
        'getMessage'            => '获取消息通知',
        'MessageDetail'         => '获取通知详情',
        'getSurrounding'        => '获取周边列表',
        'getSurroundDetail'     => '获取周边详情',
        'getNewsDetail'         => '获取新闻详情'
    ];  

    /**
     * @Description: 获取广告列表
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-11 13:52:03
     * @version: 1.0.0
     * @return [type]
     */    
    public function getAdverts(){
        $where['status'] = 1;

        $res = AdvertsLogic::getAdversList($where);

        return success($res,'获取成功');

    }
    /**
     * @Description: 获取通知列表
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-11 16:20:54
     * @version: 1.0.0
     * @return [type]
     */
    public function getMessage(){
        $params = $this->request->get();

        $res = MessageLogic::getMessage($params);

        return success($res,'获取成功');
    }

    /**
     * @Description: 获取通知详情
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-11 16:21:18
     * @version: 1.0.0
     * @return [type]
     */    
    public function MessageDetail(){
        $params = $this->request->get();

        $res = MessageLogic::getMessageDetail($params);

        return success($res,'获取详情');
    }

    /**
     * @Description: 获取周边列表
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-15 15:20:59
     * @version: 1.0.0
     * @return [type]
     */    
    public function getSurrounding(){

        $res = SurroundingLogic::getSurrounding();

        return success($res,'获取成功');
    }

    /**
     * @Description: 获取周边详情
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-15 15:42:54
     * @version: 1.0.0
     * @return [type]
     */    
    public function getSurroundDetail(){
        
        $params = $this->request->get();

        $res = SurroundingLogic::getSurroundDetail($params);

        return success($res, '获取详情成功');
    }

    /**
     * @Description: 获取新闻详情
     * @author: xiayu <cb1071403016@126.com>
     * @Date: 2022-11-15 17:20:26
     * @version: 1.0.0
     * @return [type]
     */    
    public function getNewsDetail(){

        $params = $this->request->get();
        $res = NewsLogic::getNewsDetail($params);
        
        return success($res,'获取成功');
    }
}